#ifndef __PLAYER_MODEL_H__
#define __PLAYER_MODEL_H__

#include <list>
#include <time.h>
#include "Card.h"
#include <string>
class PlayerModel
{
private:
  std::list<Card*> openedCards_;
  std::list<Card*> closedCards_;

  //player's name
  std::string name_;
  time_t connectTime_;

  void addCardsToOpenedTop(std::list<Card*> &topCards);
  void addCardsToClosedBottom(std::list<Card*> &bottomCards);
  void clearOpenedCardList();

  
public:

  PlayerModel(); 

  void addOpenedCardsToOpenedTop(PlayerModel &fromPlayer);
  void addOpenedCardsToClosedBottom(PlayerModel &fromPlayer);
  void addCardToOpenedTop(Card &topCard);
  void addCardToClosedTop(Card &topCard);

  //opens card
  int openCard();

  //returns current opened Card
  int getTopCardID() const;

  //returns current opened Card's color
  int getTopCardColor() const;
  
  int getOpenedCardsNumber() const;
  int getClosedCardsNumber() const;

  void setName(const std::string name);
  const std::string& getName()  const;
  
  void setConnectTime(const time_t &time);
  bool isWinner() const;

  
};
#endif
